Unregister XIM callbacks here. (#309054)
authorMatthias Clasen <mclasen@redhat.com>
Mon, 27 Jun 2005 02:27:41 +0000 (02:27 +0000)
committerMatthias Clasen <matthiasc@src.gnome.org>
Mon, 27 Jun 2005 02:27:41 +0000 (02:27 +0000)
2005-06-26  Matthias Clasen  <mclasen@redhat.com>

* modules/input/gtkimcontextxim.c (gtk_im_context_xim_finalize):
Unregister XIM callbacks here.  (#309054)

* modules/input/gtkimcontextxim.h: Small cleanup.

ChangeLog
ChangeLog.pre-2-10
ChangeLog.pre-2-8
modules/input/gtkimcontextxim.c
modules/input/gtkimcontextxim.h

index 179035e7d5efdc30a99667ccb718f4b69be4734e..0940e0cb9de926042dc4edae6fb1a504bb1eb747 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,10 @@
 2005-06-26  Matthias Clasen  <mclasen@redhat.com>
 
+       * modules/input/gtkimcontextxim.c (gtk_im_context_xim_finalize): 
+       Unregister XIM callbacks here.  (#309054)
+
+       * modules/input/gtkimcontextxim.h: Small cleanup.
+
        * gtk/gtkmenu.c (gtk_menu_paint): Pay attention to the
        scroll offset when drawing the box.  (#308834, Tom von 
        Schwerdtner)
index 179035e7d5efdc30a99667ccb718f4b69be4734e..0940e0cb9de926042dc4edae6fb1a504bb1eb747 100644 (file)
@@ -1,5 +1,10 @@
 2005-06-26  Matthias Clasen  <mclasen@redhat.com>
 
+       * modules/input/gtkimcontextxim.c (gtk_im_context_xim_finalize): 
+       Unregister XIM callbacks here.  (#309054)
+
+       * modules/input/gtkimcontextxim.h: Small cleanup.
+
        * gtk/gtkmenu.c (gtk_menu_paint): Pay attention to the
        scroll offset when drawing the box.  (#308834, Tom von 
        Schwerdtner)
index 179035e7d5efdc30a99667ccb718f4b69be4734e..0940e0cb9de926042dc4edae6fb1a504bb1eb747 100644 (file)
@@ -1,5 +1,10 @@
 2005-06-26  Matthias Clasen  <mclasen@redhat.com>
 
+       * modules/input/gtkimcontextxim.c (gtk_im_context_xim_finalize): 
+       Unregister XIM callbacks here.  (#309054)
+
+       * modules/input/gtkimcontextxim.h: Small cleanup.
+
        * gtk/gtkmenu.c (gtk_menu_paint): Pay attention to the
        scroll offset when drawing the box.  (#308834, Tom von 
        Schwerdtner)
index 220a04a8f25e09f8afd9965b3af4283b47138c79..86c972d238d4fc40bb0eda2ebb96a49d1f1a1ef2 100644 (file)
@@ -565,6 +565,24 @@ gtk_im_context_xim_finalize (GObject *obj)
 
   context_xim->finalizing = TRUE;
 
+  if (context_xim->im_info) 
+    {
+      GdkDisplay *display;
+      XIMCallback im_destroy_callback;
+
+      display = gdk_screen_get_display (context_xim->im_info->screen);
+      XUnregisterIMInstantiateCallback (GDK_DISPLAY_XDISPLAY (display),
+                                       NULL, NULL, NULL,
+                                       xim_instantiate_callback,
+                                       (XPointer)context_xim->im_info);
+
+      im_destroy_callback.client_data = NULL;
+      im_destroy_callback.callback = NULL;
+      XSetIMValues (context_xim->im_info->im,
+                   XNDestroyCallback, &im_destroy_callback,
+                   NULL);
+    }
+
   set_ic_client_window (context_xim, NULL);
 
   g_free (context_xim->locale);
index bdcdb08cd5cc2f5610615e34d42a193d86b93bbc..685b3944437d8c689d440196ae7e4e1b2a50fa36 100644 (file)
 #include <gtk/gtkimcontext.h>
 #include "x11/gdkx.h"
 
-#ifdef __cplusplus
-extern "C" {
-#endif /* __cplusplus */
-
+G_BEGIN_DECLS
 
 extern GType gtk_type_im_context_xim;
 
@@ -51,9 +48,7 @@ GtkIMContext *gtk_im_context_xim_new (void);
 
 void gtk_im_context_xim_shutdown (void);
 
-#ifdef __cplusplus
-}
-#endif /* __cplusplus */
+G_END_DECLS
 
 
 #endif /* __GTK_IM_CONTEXT_XIM_H__ */